package com.outstanding.junit.enums;

import com.outstanding.framework.core.BaseEnum;

public enum IsBatch implements BaseEnum<IsBatch,String> {

	YES("1", "支持批量发送"), 
	NO("2", "不支持批量发送");

	private IsBatch(String code, String name) {
		this.code = code;
		this.name = name;
	}
	
	/**
	 * 根据code获取对应枚举
	 * @param code
	 * @return
	 */
	public static IsBatch getByCode(String code) {
		IsBatch[] array = IsBatch.values();
		for (IsBatch bd : array) {
			if (bd.getCode().equals(code)) {
				return bd;
			}
		}
		return null;
	}

	private String code;

	private String name;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
